Exact copy of \toolbox\matlab\codetools\urlencode.m. NOTE For some reason using urldecode conflicts with compiler. Using urldecode_utf is a workaround. For completeness was copied to urlencode to urlencode_utf